// Copyright (c) 2007 Robin Boerdijk. All rights reserved.
//
// This software is licensed under the terms of the Microsoft Reciprocal License as described 
// in the file LICENSE.txt, which you should have received as part of this distribution. The 
// license terms are also available at http://www.opensource.org/licenses/ms-rl.html.

#include "wtkpc.h"

#include "wtk/WindowClass.h"
#include "wtk/Error.h"

namespace wtk
{
	WindowClass::WindowClass(HINSTANCE instanceHandle, LPCWSTR className)
	{
		m_info.cbSize = sizeof(m_info);
		win32::GetClassInfoExW(instanceHandle, className, &m_info);
	}

	std::ostream &operator<<(std::ostream &out, const WindowClass &wc) 
	{
		out << "WindowClass " << wc.ClassName();
		return out;
	}

	// static
	const wchar_t *WindowClass::AtomToClassName(ATOM atom)
	{
		return reinterpret_cast<const wchar_t *>(MAKELONG(atom, 0));
	}
}
